﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="MemberPromotionModify.aspx.cs" Inherits="bianzhuo.SupportPlatform.BzBusiness.MemberPromotionModify" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>商家管理</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="css/tem_css.css" rel="stylesheet" type="text/css" />
    <link href="css/msg_css.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="js/tdcolor.js" type="text/javascript"></script>
    <script type="text/javascript" src="ckeditor/ckeditor.js"></script>
    <script src="ckfinder/ckfinder.js" type="text/javascript"></script>
    <script src="js/UpLoadImgByFinderJGG.js" type="text/javascript"></script>
    <script src="js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="js/common.js" type="text/javascript"></script>
    <style>
        .prizetype2, .prizetype3, .prizetype4 {
            display: none;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div class="content">
            <ul class="breadcrumb">
                <li>
                    <div class="tem_img tem_l" title="关闭左侧菜单" id="closeleftframe" onclick="parent.document.getElementsByTagName('frameset')[1].cols = '0,*'; $('#closeleftframe').hide(); $('#openleftframe').show();"></div>
                    <div class="tem_img tem_r" title="展开左侧菜单" id="openleftframe" onclick="parent.document.getElementsByTagName('frameset')[1].cols = '240,*';$('#closeleftframe').show();$('#openleftframe').hide();"></div>
                </li>
                <li><a href="javascript:;">首页</a> <span class="divider">/</span></li>
                <li class="active">会员促销活动设置</li>
            </ul>
            <div class="container">
                <div class="member_div">
                    <ul>
                        <li>
                            <div class="mem_dbg mem_dbg01 mem_dtmd"></div>
                            <div class="mem_dtit"><a class="mem_dta" href="UserCardModify.aspx?MicroId=<%=Request["MicroId"]%>">会员卡设置</a></div>
                        </li>
                        <li>
                            <div class="mem_dbg mem_dbg02 mem_dtmd"></div>
                            <div class="mem_dtit"><a class="mem_dta" href="MemberClassDefault.aspx?MicroId=<%=Request["MicroId"]%>">会员卡等级</a></div>
                        </li>
                        <li>
                            <div class="mem_dbg mem_dbg03 mem_dtmd"></div>
                            <div class="mem_dtit"><a class="mem_dta" href="MemberPackageDefault.aspx?MicroId=<%=Request["MicroId"]%>">会员卡套餐</a></div>
                        </li>
                        <li>
                            <div class="mem_dbg mem_dbg04 "></div>
                            <div class="mem_dtit"><a class="mem_dth" href="MemberPromotionDefault.aspx?MicroId=<%=Request["MicroId"]%>">会员促销活动</a></div>
                        </li>
                        <li>
                            <div class="mem_dbg mem_dbg05 mem_dtmd"></div>
                            <div class="mem_dtit"><a class="mem_dta" href="UserInfoDefault.Aspx?MicroId=<%=Request["MicroId"]%>">会员管理</a></div>
                        </li>
                        <li>
                            <div class="mem_dbg mem_dbg06 mem_dtmd"></div>
                            <div class="mem_dtit"><a class="mem_dta" href="PointProManager/PointProductTypeManager.aspx">积分商城</a></div>
                        </li>
                    </ul>
                </div>
                <div>
                    <table class="user_list tab0" border="0" cellspacing="0" cellpadding="0" data-title="打折、优惠券、赠送">

                        <tr>
                            <th colspan="2" align="left" class="border_left">添加会员促销活动</th>
                        </tr>
                        <tr class="td25">
                            <td width="12%" height="30" align="right" class="border_left">&nbsp;活动类型</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    &nbsp;
                                    <input type="radio" name="proType1" id="proType1" checked="checked" value="1" />&nbsp;<%=PromType[1] %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="proType1" id="proType2" value="2" />&nbsp;<%=PromType[2] %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="proType1" id="proType3" value="3" />&nbsp;<%=PromType[3] %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="proType1" id="proType4" value="4" />&nbsp;<%=PromType[4] %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="proType1" id="proType5" value="5" />&nbsp;<%=PromType[5] %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="proType1" id="proType6" value="6" />&nbsp;<%=PromType[6] %>
                                    <input type="radio" onclick="location.href = 'Member/MemberPromotionWxSQ.aspx?MicroId=<%=Request["MicroId"]%>&type=formA'" name="proType1" id="proType7" value="7" />&nbsp;<%=PromType[7] %><span class="webnav_hot">New</span>
                                    <input type="radio" name="proType1" id="proType8" value="8" />&nbsp;<%=PromType[8] %>
                                </div>
                                <div class="lmlx_ts">
                                    <font id="lbMsg">打折活动针对商家指定商品进行打折。</font>
                                    <span class="lmx_but">×</span>
                                </div>
                                <input id="proType" name="proType" type="hidden" runat="server" value="1" />
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left">活动名称</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proName" name="proName" type="text" class="input_text" runat="server" /><span class="tips">活动名称</span></div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left" width="12%">活动海报</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    <input id="proPlacard" name="proPlacard" class="input_text" type="hidden" runat="server" /><div id="pic" class="onepic"></div>
                                    &nbsp;<span class="tips">建议尺寸：990×320</span>
                                </div>
                            </td>
                        </tr>

                        <tr>
                            <td height="30" align="right" class="border_left">活动有效期</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proStartTime" name="proStartTime" type="text" class="input_text10 datetime" runat="server" /><span class="tips5">&nbsp;到&nbsp;</span><input id="proEndTime" name="proEndTime" type="text" class="input_text10 datetime" runat="server" /></div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left">奖品截止期</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proPrizeEndTime" name="proPrizeEndTime" type="text" class="input_text10 datetime" runat="server" /><span class="tips5">&nbsp;</span></div>
                            </td>
                        </tr>
                        <tr class="proms prom1">
                            <td height="30" align="right" class="border_left">活动内容</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    &nbsp;<input id="proDiscountRadio" name="proDiscountRadio" type="text" class="input_text10" runat="server" data-type="float" min="0.01" max="1" /><span class="tips5">指定商品享受折扣,打9折输入0.9，不打折输入1</span>
                                </div>
                            </td>
                        </tr>
                        <tr class="proms prom1">
                            <td height="30" align="right" class="border_left">折扣类型</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    &nbsp;<select id="proDiscountType" name="proDiscountType" class="btn" runat="server">
                                        <option value="">选择折扣类型</option>
                                        <option value="1">覆盖之前折扣</option>
                                        <option value="2">追加折扣</option>
                                    </select>&nbsp;&nbsp;&nbsp;&nbsp;<span class="tips5">&nbsp;<font class="proDiscountType1">覆盖会员卡等级中打折优惠</font><font class="proDiscountType2">会员卡等级打折优惠上追加现有优惠</font></span>
                                </div>
                            </td>
                        </tr>
                        <tr class="proms prom2">
                            <td height="30" align="right" class="border_left">活动内容</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<span class="tips5">订单满</span>&nbsp;<input type="text" id="proCouponOrderMoney" name="proCouponOrderMoney" class="input_text10" runat="server" data-type="int" />&nbsp;&nbsp;<span class="tips5">立减</span>&nbsp;&nbsp;<input type="text" id="proCouponValue" name="proCouponValue" class="input_text11" runat="server" data-type="int" />&nbsp;&nbsp;<span class="tips5">元优惠券</span></div>
                            </td>
                        </tr>
                        <tr class="proms prom1">
                            <td height="30" align="right" class="border_left">打折图片</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    <input type="hidden" name="txt_pics1" id="txt_pics1" runat="server" />
                                <div class="allpic"></div>
                                </div>
                            </td>
                        </tr>
                        <tr class="proms prom2">
                            <td height="30" align="right" class="border_left">优惠券图片</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    <input type="hidden" name="txt_pics2" id="txt_pics2" runat="server" />
                                <div class="allpic"></div>
                                </div>
                            </td>
                        </tr>
                        <tr class="proms prom3">
                            <td height="30" align="right" class="border_left">活动内容</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proGiftName" name="proGiftName" type="text" class="input_text10" runat="server" /><span class="tips5">免费领取商品名称</span>&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="proGiftNumber" name="proGiftNumber" class="input_text11" data-type="int" runat="server" /><span class="tips5">商品数量</span>&nbsp;&nbsp;<input type="text" id="proGiftUnit" name="proGiftUnit" class="input_text11" runat="server" /><span class="tips5">商品单位</span></div>
                            </td>
                        </tr>
                        <tr class="prom5source" style="display: none">
                            <td height="30" align="right" class="border_left">奖品设置</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    &nbsp;&nbsp;<input name="PrizeLevel" type="text" class="input_text10" value="" />&nbsp;&nbsp;<select name="PrizeType" class="btn PrizeType">
                                        <option value="1">奖品</option>
                                        <%--<option value="2">商品</option>--%>
                                        <option value="3">积分</option>
                                        <option value="4">红包</option>
                                    </select>&nbsp;&nbsp;&nbsp;&nbsp;
                                    <span class="prizetype1">奖品名称&nbsp;&nbsp;</span><input name="PrizeName" type="text" class="input_text10 prizetype1" />
                                    <span class="prizetype2">选择商品&nbsp;&nbsp;</span><div class="zjd_spm prizetype2">
                                        <button type="button" class="btn btn-03 addhdsp prizetype2" style="overflow: hidden">商品指定</button>
                                        <input name="PrizeGoodsFunId" type="hidden" class="input_text10" />
                                        <input name="PrizeGoodsCateId" type="hidden" class="input_text10" />
                                        <input name="PrizeGoodsId" type="hidden" class="input_text10" />
                                        <input name="PrizeGoodsName" type="hidden" class="input_text10" />
                                    </div>
                                    <span class="prizetype3">积分额度&nbsp;&nbsp;</span><input name="PrizePoint" type="text" class="input_text10 prizetype3" />
                                    <span class="prizetype4">红包额度&nbsp;&nbsp;</span><input name="PrizeHongbao" type="text" class="input_text10 prizetype4" />
                                    &nbsp;&nbsp;&nbsp;&nbsp;奖品数量&nbsp;&nbsp;<input name="PrizeNumber" type="text" class="input_text11" />
                                </div>
                            </td>
                        </tr>
                        <asp:Repeater ID="rptPrize" runat="server">
                            <ItemTemplate>
                                <tr class="proms prom5">
                                    <td height="30" align="right" class="border_left">奖品设置</td>
                                    <td height="30" align="left">
                                        <div class="lmlx_inf">
                                            &nbsp;&nbsp;<input name="PrizeLevel" type="text" class="input_text10" value="<%#Eval("PrizeLevel") %>" />&nbsp;&nbsp;<select name="PrizeType" class="btn PrizeType">
                                                <option value="1" <%#(Eval("PrizeType").ToString()=="1")?"selected":"" %>>奖品</option>
                                                <%--<option value="2" <%#(Eval("PrizeType").ToString()=="2")?"selected":"" %>>商品</option>--%>
                                                <option value="3" <%#(Eval("PrizeType").ToString()=="3")?"selected":"" %>>积分</option>
                                                <option value="4" <%#(Eval("PrizeType").ToString()=="4")?"selected":"" %>>红包</option>
                                            </select>&nbsp;&nbsp;&nbsp;&nbsp;
                                    <span class="prizetype1">奖品名称&nbsp;&nbsp;</span><input name="PrizeName" type="text" class="input_text10 prizetype1" value="<%#Eval("PrizeName")%>" />
                                            <span class="prizetype2">选择商品&nbsp;&nbsp;</span><div class="zjd_spm prizetype2">
                                                <button type="button" class="btn btn-03 addhdsp prizetype2" style="overflow: hidden"><%#(Eval("PrizeGoodsName") != null)?Eval("PrizeGoodsName").ToString():"商品指定"%></button>
                                                <input name="PrizeGoodsFunId" type="hidden" class="input_text10" value="<%#Eval("PrizeGoodsFunId")%>" />
                                                <input name="PrizeGoodsCateId" type="hidden" class="input_text10" value="<%#Eval("PrizeGoodsCateId")%>" />
                                                <input name="PrizeGoodsId" type="hidden" class="input_text10" value="<%#Eval("PrizeGoodsId")%>" />
                                                <input name="PrizeGoodsName" type="hidden" class="input_text10" value="<%#Eval("PrizeGoodsName")%>" />
                                            </div>
                                            <span class="prizetype3">积分额度&nbsp;&nbsp;</span><input name="PrizePoint" type="text" class="input_text10 prizetype3" value="<%#Eval("PrizePoint")%>" />
                                            <span class="prizetype4">红包额度&nbsp;&nbsp;</span><input name="PrizeHongbao" type="text" class="input_text10 prizetype4" value="<%#Eval("PrizeHongbao")%>" />
                                            &nbsp;&nbsp;&nbsp;&nbsp;奖品数量&nbsp;&nbsp;<input name="PrizeNumber" type="text" class="input_text11" value="<%#Eval("PrizeNumber")%>" />
                                        </div>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                        <tr class="proms prom5">
                            <td height="30" align="right" class="border_left"></td>
                            <td height="30" align="left">
                                <button type="button" class="btn btn-03 addprize">添加奖项</button></td>
                        </tr>
                        <tr class="proms prom5">
                            <td height="30" align="right" class="border_left">&nbsp;预计活动的人数</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proEggPlanNumber" name="proEggPlanNumber" data-type="int" runat="server" type="text" class="input_text10" /><span class="tips">中奖概率 = 奖品总数/(预估活动人数*每人抽奖次数) 如果要确保任何时候都100%中奖建议设置为1人参加!</span></div>
                            </td>
                        </tr>
                        <tr class="proms prom5">
                            <td height="30" align="right" class="border_left">&nbsp;抽奖次数</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proEggMaxNumber" name="proEggMaxNumber" data-type="int" runat="server" type="text" class="input_text10" /><span class="tips">必须为数字，<font>0</font>为无上限</span></div>
                            </td>
                        </tr>
                        <tr class="proms prom5">
                            <td height="30" align="right" class="border_left">&nbsp;每天抽奖次数</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proEggDayNumber" name="proEggDayNumber" data-type="int" runat="server" type="text" class="input_text10" /><span class="tips">必须小于总抽奖次数！<font>0</font>为不限制 </span></div>
                            </td>
                        </tr>
                        <tr class="proms prom6">
                            <td height="30" align="right" class="border_left">奖品设置</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    <input name="PrizeLevel6" type="hidden" />
                                    &nbsp;&nbsp;<select name="PrizeType6" class="btn PrizeType">
                                        <option value="1" <%=(Prom6Prize != null && Prom6Prize.PrizeType==1)?"selected":"" %>>奖品</option>
                                        <%--<option value="2" <%=(Prom6Prize != null && Prom6Prize.PrizeType==2)?"selected":"" %> >商品</option>--%>
                                        <option value="3" <%=(Prom6Prize != null && Prom6Prize.PrizeType==3)?"selected":"" %>>积分</option>
                                        <option value="4" <%=(Prom6Prize != null && Prom6Prize.PrizeType==4)?"selected":"" %>>红包</option>
                                    </select>&nbsp;&nbsp;&nbsp;&nbsp;
                                    <span class="prizetype1">奖品名称&nbsp;&nbsp;</span><input name="PrizeName6" type="text" class="input_text10 prizetype1" value="<%=Prom6Prize.PrizeName%>" />
                                    <span class="prizetype2">选择商品&nbsp;&nbsp;</span><div class="zjd_spm prizetype2">
                                        <button type="button" class="btn btn-03 addhdsp prizetype2" style="overflow: hidden">商品指定</button>
                                        <input name="PrizeGoodsFunId6" type="hidden" class="input_text10" value="<%=Prom6Prize.PrizeGoodsFunId %>" />
                                        <input name="PrizeGoodsCateId6" type="hidden" class="input_text10" value="<%=Prom6Prize.PrizeGoodsCateId %>" />
                                        <input name="PrizeGoodsId6" type="hidden" class="input_text10" value="<%=Prom6Prize.PrizeGoodsId %>" />
                                        <input name="PrizeGoodsName6" type="hidden" class="input_text10" value="<%=Prom6Prize.PrizeGoodsName %>" />
                                    </div>
                                    <span class="prizetype3">积分额度&nbsp;&nbsp;</span><input name="PrizePoint6" type="text" class="input_text10 prizetype3" value="<%=Prom6Prize.PrizePoint%>" />
                                    <span class="prizetype4">红包额度&nbsp;&nbsp;</span><input name="PrizeHongbao6" type="text" class="input_text10 prizetype4" value="<%=Prom6Prize.PrizeHongbao %>" />
                                    &nbsp;&nbsp;&nbsp;&nbsp;奖品数量&nbsp;&nbsp;<input name="PrizeNumber6" type="text" class="input_text11" data-type="int" value="<%=Prom6Prize.PrizeNumber %>" /><span class="tips">&nbsp;</span>
                                </div>
                            </td>
                        </tr>
                        <tr class="proms prom6">
                            <td height="30" align="right" class="border_left" width="12%">奖品图片</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    <input id="PrizeGoodsPic" name="PrizeGoodsPic" class="input_text" type="hidden" runat="server" /><div id="Div1" class="onepic"></div>
                                    &nbsp;<span class="tips">建议尺寸：200×200</span>
                                </div>
                            </td>
                        </tr>
                        <%--<tr class="proms prom8">
                            <td height="30" align="right" class="border_left" width="12%">谢谢参与</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    <input id="imgxxhgtype8" name="imgtype8" class="input_text" type="hidden" runat="server" /><div id="Div2" class="onepic"></div>
                                    &nbsp;<span class="tips">建议尺寸：100×100</span>
                                </div>
                            </td>
                        </tr>--%>
                        <tr class="proms img8">
                            <td height="30" align="right" class="border_left">奖品设置111</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">

                                    <input name="PrizeLevel8" type="text" class="input_text10" value="" />&nbsp;&nbsp;<select name="PrizeType8" class="btn PrizeType" onchange="Change8(this)">
                                        <option value="1">奖品</option>
                                        <option value="3">积分</option>
                                        <option value="4">红包</option>
                                    </select>&nbsp;&nbsp;&nbsp;&nbsp;
                                    <span class="prizetype1">奖品名称&nbsp;&nbsp;</span><input name="PrizeName8" type="text" class="input_text10 prizetype1" />
                                    <span class="prizetype3">积分额度&nbsp;&nbsp;</span><input name="PrizePoint8" type="text" class="input_text10 prizetype3" />
                                    <span class="prizetype4">红包额度&nbsp;&nbsp;</span><input name="PrizeHongbao8" type="text" class="input_text10 prizetype4" />
                                    &nbsp;&nbsp;&nbsp;&nbsp;奖品数量&nbsp;&nbsp;<input name="PrizeNumber8" type="text" class="input_text11" />
                                    &nbsp;&nbsp;
                                    &nbsp;&nbsp;
                                    <input name="PrizeImg8" class="input_text prizetype1" type="hidden" /><div class="onepic prizetype1" style="display: inline-block;"></div>
                                    <span class="tips prizetype1">建议尺寸：120×120</span>
                                </div>
                            </td>
                        </tr>
                        <asp:Repeater ID="rptPrize8" runat="server">
                            <ItemTemplate>
                                <tr class="proms prom8">
                                    <td height="30" align="right" class="border_left">奖品设置</td>
                                    <td height="30" align="left">
                                        <div class="lmlx_inf">

                                            <input name="PrizeLevel8" type="text" class="input_text10" value="<%#Eval("PrizeLevel") %>" />&nbsp;&nbsp;<select name="PrizeType8" class="btn PrizeType">
                                                <option value="1" <%#(Eval("PrizeType").ToString()=="1")?"selected":"" %>>奖品</option>
                                                <option value="3" <%#(Eval("PrizeType").ToString()=="3")?"selected":"" %>>积分</option>
                                                <option value="4" <%#(Eval("PrizeType").ToString()=="4")?"selected":"" %>>红包</option>
                                            </select>&nbsp;&nbsp;&nbsp;&nbsp;
                                    <span class="prizetype1">奖品名称&nbsp;&nbsp;</span><input name="PrizeName8" type="text" class="input_text10 prizetype1" value="<%#Eval("PrizeName")%>" />
                                            <span class="prizetype3">积分额度&nbsp;&nbsp;</span><input name="PrizePoint8" type="text" class="input_text10 prizetype3" value="<%#Eval("PrizePoint")%>" />
                                            <span class="prizetype4">红包额度&nbsp;&nbsp;</span><input name="PrizeHongbao8" type="text" class="input_text10 prizetype4" value="<%#Eval("PrizeHongbao")%>" />
                                            &nbsp;&nbsp;&nbsp;&nbsp;奖品数量&nbsp;&nbsp;<input name="PrizeNumber8" type="text" class="input_text11" value="<%#Eval("PrizeNumber")%>" />
                                            &nbsp;&nbsp;
                                            &nbsp;&nbsp;
                                            <input name="PrizeImg8" class="input_text prizetype1" type="hidden" value="<%# Eval("PrizeGoodsPic") %>" /><div class="onepic prizetype1" style="display: inline-block;"></div>
                                            <span class="tips prizetype1">建议尺寸：120×120</span>
                                        </div>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                        <%--<tr>
                            <td height="30" align="right" class="border_left"><span class="biaoji">*</span>&nbsp;奖品设置</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    &nbsp;&nbsp;<input type="text" class="input_text10" value="1等奖" />&nbsp;&nbsp;<select name="fenlei" class="btn">
                                        <option value="1">奖品</option>
                                        <option value="2">积分</option>
                                        <option value="2">红包</option>
                                    </select>&nbsp;&nbsp;&nbsp;&nbsp;
                                    奖品名称&nbsp;&nbsp;<input type="text" class="input_text10" />&nbsp;&nbsp;&nbsp;&nbsp;
                                    奖品数量&nbsp;&nbsp;<input type="text" class="input_text11" />&nbsp;&nbsp;&nbsp;&nbsp;
                                    奖品图片&nbsp;&nbsp;<input type="file" class="input_text10" />
                                    <input name="PrizeImg8" class="input_text10" type="hidden" /><div class="onepic" style="display: inline-block;"></div><span class="tips">建议尺寸：120×120</span>
                                </div>
                            </td>
                        </tr>--%>
                        <tr class="proms prom8">
                            <td height="30" align="right" class="border_left"></td>
                            <td height="30" align="left">
                                <button type="button" class="btn btn-03 addprize8">添加奖项</button></td>
                        </tr>
                        <tr class="proms prom8">
                            <td height="30" align="right" class="border_left"><span class="biaoji">*</span>&nbsp;预计活动的人数</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proJggPlanNumber8" name="proJggPlanNumber8" data-type="int" runat="server" type="text" class="input_text10" /><span class="tips">中奖概率 = 奖品总数/(预估活动人数*每人抽奖次数) 如果要确保任何时候都100%中奖建议设置为1人参加!</span></div>
                            </td>
                        </tr>
                        <tr class="proms prom8">
                            <td height="30" align="right" class="border_left"><span class="biaoji">*</span>&nbsp;抽奖次数</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proJggMaxNumber8" name="proJggMaxNumber8" data-type="int" runat="server" type="text" class="input_text10" /><span class="tips">必须为数字，<font>0</font>为无上限</span></div>
                            </td>
                        </tr>
                        <tr class="proms prom8">
                            <td height="30" align="right" class="border_left"><span class="biaoji">*</span>&nbsp;每天抽奖次数</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proJggDayNumber8" name="proJggDayNumber8" data-type="int" runat="server" type="text" class="input_text10" /><span class="tips">必须小于总抽奖次数！<font>0</font>为不限制 </span></div>
                            </td>
                        </tr>
                        <tr class="proms prom8">
                            <td height="30" align="right" class="border_left"><span class="biaoji">*</span>&nbsp;开启积分抽奖</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input type="checkbox" runat="server" id="point8" name="point8" /><span class="tips">使用会员积分兑换抽奖</span></div>
                            </td>
                        </tr>
                        <tr class="proms prom88">
                            <td height="30" align="right" class="border_left"><span class="biaoji">*</span>&nbsp;消耗积分</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proJggCardPoints" name="proJggCardPoints" data-type="int" runat="server" type="text" class="input_text10" /><span class="tips">每次抽奖消耗积分数，必须为数字。</span></div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left">参与方式</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    &nbsp;<select id="proParticipation" name="proParticipation" class="btn" runat="server">
                                        <option value="">选择参与方式</option>
                                        <option value="1">领卡就送</option>
                                        <option value="2">先抢先得</option>
                                        <option value="3">全员赠送</option>
                                        <option value="5">老会员赠送</option>
                                    </select>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left">&nbsp;指定商品</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    &nbsp;
                                    <button id="proGoods" type="button" class="btn btn-02 addhdsp">商品指定</button><span class="tips"><%=(GoodsId.Value.Split(new char[] { ',' }).Length>1)?"指定"+GoodsId.Value.Split(new char[] { ',' }).Length.ToString()+"件商品":"未指定商品" %></span>
                                </div>
                                <input type="hidden" id="GoodsId" name="GoodsId" value="" runat="server" />
                                <input type="hidden" id="GoodsPrice" name="GoodsPrice" value="" runat="server" />
                                <input type="hidden" id="GoodsName" name="GoodsName" value="" runat="server" />
                                <input type="hidden" id="FunctionId" name="FunctionId" value="" runat="server" />
                                <input type="hidden" id="GoodsCateId" name="GoodsCateId" value="" runat="server" />
                            </td>
                        </tr>
                        <tr class="Participation">
                            <td height="30" align="right" class="border_left">&nbsp;发放数量</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proNumber" name="proNumber" type="text" class="input_text10" runat="server" data-type="int" value="0" /><span class="tips">张&nbsp;&nbsp;<font>0</font>表示不限制</span></div>
                            </td>
                        </tr>
                        <tr style="display: none">
                            <td height="30" align="right" class="border_left">活动关注地址</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proPageUrl" name="proPageUrl" type="text" class="input_text" runat="server" /><span class="tips5">&nbsp;活动吸引粉丝进行关注,填写关注地址。</span></div>
                            </td>
                        </tr>

                        <tr>
                            <td height="30" align="right" class="border_left">&nbsp;活动说明</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<textarea id="proDescription" name="proDescription" rows="5" cols="50" runat="server" class="ckeditor"></textarea></div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="border_left">
                                <button type="submit" class="btn btn-01" id="save" name="save">确定添加</button>&nbsp;&nbsp;&nbsp;&nbsp;
                                 <button type="button" class="btnhs" onclick="history.go(-1);">取消返回</button></td>
                        </tr>
                    </table>

                    <table class="user_list tab1" border="0" cellspacing="0" cellpadding="0" data-title="秒杀第一步">

                        <tr>
                            <th colspan="2" align="left" class="border_left">
                                <div class="hd_mslc">
                                    <ul>
                                        <li><span class="hd_mslc_ico">01</span><font>秒杀活动设置</font></li>
                                        <li><span class="hd_mslc_ico2">02</span>秒杀模版设置</li>
                                    </ul>
                                </div>
                            </th>
                        </tr>
                        <tr class="td25">
                            <td width="12%" height="30" align="right" class="border_left">&nbsp;活动类型</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    &nbsp;
                                    <input type="radio" name="protype2" id="protype21" value="1" />&nbsp;<%=PromType[1] %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="protype2" id="protype22" value="2" />&nbsp;<%=PromType[2] %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="protype2" id="protype23" value="3" />&nbsp;<%=PromType[3] %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="protype2" id="protype24" value="4" />&nbsp;<%=PromType[4] %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="protype2" id="protype25" value="5" />&nbsp;<%=PromType[5] %><span class="webnav_hot">New</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="radio" name="protype2" id="protype26" value="6" />&nbsp;<%=PromType[6] %><span class="webnav_hot">New</span>
                                    <input type="radio" name="protype2" id="protype27" value="8" />&nbsp;<%=PromType[8] %>
                                </div>
                                <div class="lmlx_ts">发布商品秒杀活动，设置好活动需指定参与活动的商品才能启动活动。<span class="lmx_but">×</span></div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left">活动名称</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input type="text" id="proSeckillName" name="proSeckillName" class="input_text" runat="server" /><span class="tips">会员促销活动名称</span></div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left">秒杀时间</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input type="text" id="proSeckillStartTime" name="proSeckillStartTime" class="input_text10 datetime" runat="server" /><span class="tips5">秒杀开始时间</span></div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left">奖品截止期</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proSeckillPrizeEndTime" name="proSeckillPrizeEndTime" type="text" class="input_text10 datetime" runat="server" /><span class="tips5">&nbsp;</span></div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left">秒杀价格</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input type="text" id="proSeckillPrice" name="proSeckillPrice" class="input_text10" runat="server" data-type="float" /><span class="tips5">指定商品秒杀价格</span></div>
                            </td>
                        </tr>
                        <tr style="display: none">
                            <td height="30" align="right" class="border_left">参与方式</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    &nbsp;<select name="proSeckillParticipation" id="proSeckillParticipation" class="btn" runat="server">
                                        <option value="0">选择参与方式</option>
                                        <option value="2" selected="selected">先抢先得</option>
                                    </select>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left">&nbsp;指定秒杀商品</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    &nbsp;
                                    <button type="button" class="btn btn-02 addhdsp">商品指定</button><span class="tips">未指定商品</span>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left">&nbsp;发放数量</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input type="text" id="proSeckillNumber" name="proSeckillNumber" class="input_text10" data-type="int" value="0" runat="server" /><span class="tips">名额&nbsp;&nbsp;数量>0</span></div>
                            </td>
                        </tr>

                        <tr>
                            <td colspan="2" class="border_left">
                                <button type="button" class="btn btn-01 btnseckill1">完成下一步</button>&nbsp;&nbsp;&nbsp;&nbsp;
                                <button type="button" class="btnhs" onclick="history.go(-1);">取消返回</button></td>
                        </tr>
                    </table>
                    <table class="user_list tab2" border="0" cellspacing="0" cellpadding="0" data-title="秒杀第二步">

                        <tr>
                            <th colspan="2" align="left" class="border_left">
                                <div class="hd_mslc">
                                    <ul>
                                        <li><span class="hd_mslc_ico2">01</span>秒杀活动设置</li>
                                        <li><span class="hd_mslc_ico">02</span><font>秒杀模版设置</font></li>
                                    </ul>
                                </div>
                            </th>
                        </tr>

                        <tr>
                            <td height="30" align="right" class="border_left" width="12%">秒杀海报</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">
                                    &nbsp;<input id="proSeckillPlacard" name="proSeckillPlacard" class="input_text" type="hidden" runat="server" /><div id="ico" class="onepic"></div>
                                    <span class="tips">尺寸：640×400</span>
                                </div>
                            </td>
                        </tr>

                        <tr style="display: none">
                            <td height="30" align="right" class="border_left">秒杀模板地址</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<input id="proSeckillTempUrl" name="proSeckillTempUrl" type="text" class="input_text" runat="server" /><span class="tips">&nbsp;</span></div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left">秒杀攻略</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<textarea id="proSeckillGospel" name="proSeckillGospel" rows="8" cols="38" runat="server" class="ckeditor"></textarea></div>
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align="right" class="border_left">活动规则</td>
                            <td height="30" align="left">
                                <div class="lmlx_inf">&nbsp;<textarea id="proSeckillRules" name="proSeckillRules" rows="8" cols="38" runat="server" class="ckeditor"></textarea></div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="border_left">
                                <button type="button" class="btn btn-01 btnseckill2">确定添加</button>&nbsp;&nbsp;&nbsp;&nbsp;
                                <button type="button" class="btnhs" onclick="history.go(-1);">取消返回</button>&nbsp;&nbsp;&nbsp;&nbsp;
                                <%--<button type="button" class="btn btn-02 msxyl">预览秒杀活动</button>--%>

                            </td>
                        </tr>
                    </table>


                </div>
            </div>
        </div>


        <div class="tem_mdiv">
            <div class="tem_mdiv_tit">预览当前效果<span></span></div>
            <div class="temyr_main">
                <iframe scrolling="auto" frameborder="0" src="" class="tem_ifm" width="440" height="606" style="overflow-x: hidden;"></iframe>
            </div>
        </div>

        <div class="zdsphd_mdiv">
            <div class="zdsphd_tit">选择商品参加活动<span></span></div>
            <div class="zdsphd_main">
                <!--左侧分类-->
                <div class="hdtit_div">
                    <div class="hdtit_ldiv">
                        <%--<asp:Repeater ID="Repeater1" runat="server">
                           <div class="hdtit_ldiv">
                            <li class="mem_zdhd1 goodscate"><a class="zdhd_dta" href="javascript:;">商城<font>(10/58)</font></a></li>
                            <div class="hd_ldlist">
                                <ul>
                                    <li><a class="zdhd_dta" href="javascript:;">衬衫<font>(3/10)</font></a></li>
                                   
                                </ul>
                            </div>
                        </div>
                       </asp:Repeater>--%>
                        <%=CateList%>
                    </div>
                </div>
                <!--右侧商品-->
                <div class="hdtit_rdiv">
                    <div class="hdtit_rsea">
                        <div class="hdtit_rseal">
                            <input type="text" id="keyword" />
                        </div>
                        <div class="hdtit_rsear">
                            <button type="button" id="search">搜索商品</button>
                        </div>
                    </div>
                    <div class="hdtit_rptit">
                        <input type="checkbox" id="selall" />&nbsp;&nbsp;选中全部<font>(0)</font>
                    </div>
                    <!--商品列表-->
                    <div class="hdtit_rpliov">
                        <div class="hdtit_rplist">
                            <ul>
                            </ul>
                        </div>
                        <div class="hdtit_rpage">查看更多<font>[<span class="goodsviewcount">0</span>/<span class="goodscount">0</span>]</font></div>
                    </div>
                    <!--商品分页-->

                </div>
            </div>
            <div class="zdsphd_mainbut">
                <button type="button" class="btn btn-01 xzok">确定选择</button>&nbsp;&nbsp;
            <button type="button" class="btn xzcancel">取消返回</button>
            </div>
        </div>
    </form>
    <script>
        Array.prototype.unique = function () {
            var n = {}, r = []; //n为hash表，r为临时数组
            for (var i = 0; i < this.length; i++) //遍历当前数组
            {
                if (!n[this[i]]) //如果hash表中没有当前项
                {
                    n[this[i]] = true; //存入hash表
                    r.push(this[i]); //把当前数组的当前项push到临时数组里面
                }
            }
            return r;
        }
        //是否开启消耗积分
        $('#point8').click(function(){
            Point8();
        })

        //添加奖项
        $('.addprize').click(function () {
            var source = $('tr.prom5source').clone(true);
            source.find('select').val(1);
            source.find('.prizetype2,.prizetype3,.prizetype4').hide();
            source.find('.prizetype1').show();
            source.find('button.addhdsp.prizetype2').html('商品指定');
            source.addClass('proms prom5').removeClass('prom5source').find('input').val('');;
            source.find('[name=PrizeLevel]').val(($('[name=PrizeLevel]').length) + '等奖');
            source.show();
            $(this).parents('tr').before(source);
        })<%=(rptPrize.Items.Count==0)?".click();":""%>
        //添加奖项
        $('.addprize8').click(function () {

            var html = ""; 
            //html = "<div class=\"finder_img\">";
            //html += "     <div class=\"imgleft\" val=\"\">";
            //html += "   选择单张";
            //html += "  </div>";
            //html += "  <div class=\"imgbox\">";
            //html += "   <div class=\"bottom\">共0张</div>";
            //html += "  <a href=\"javascript:void(0)\" target=\"_blank\">";
            //html += "    <img src=\"../images/nopic.gif\" />";
            //html += "  </a>";
            //html += "  </div>";
            //html += "   </div>";

            

            var html8="<tr class=\"proms prom8 img8\" >";
            html8+="<td height=\"30\" align=\"right\" class=\"border_left\">奖品设置</td>";
            html8+="<td height=\"30\" align=\"left\">";
            html8+="<div class=\"lmlx_inf\">";
            //html8+="<input name=\"PrizeImg8\" class=\"input_text\" type=\"hidden\" /><div class=\"onepic\">"+html+"</div>&nbsp;&nbsp;&nbsp;&nbsp;";
            html8+="<input name=\"PrizeLevel8\" type=\"text\" class=\"input_text10\" value=\""+($('[name=PrizeLevel8]').length) + "等奖\" />&nbsp;&nbsp;";
            html8+="<select name=\"PrizeType8\" class=\"btn PrizeType\" onchange=\"Change8(this)\">";
            html8+="<option value=\"1\">奖品</option><option value=\"3\">积分</option><option value=\"4\">红包</option></select>&nbsp;&nbsp;&nbsp;&nbsp;";
            html8+="<span class=\"prizetype1\">奖品名称&nbsp;&nbsp;</span><input name=\"PrizeName8\" type=\"text\" class=\"input_text10 prizetype1\" />";
            html8+="<span class=\"prizetype3\">积分额度&nbsp;&nbsp;</span><input name=\"PrizePoint8\" type=\"text\" class=\"input_text10 prizetype3\" />";
            html8+="<span class=\"prizetype4\">红包额度&nbsp;&nbsp;</span><input name=\"PrizeHongbao8\" type=\"text\" class=\"input_text10 prizetype4\" />";
            html8+="&nbsp;&nbsp;&nbsp;&nbsp;奖品数量&nbsp;&nbsp;<input name=\"PrizeNumber8\" type=\"text\" class=\"input_text11\" />";
            html8+="&nbsp;&nbsp;&nbsp;&nbsp;";
            html8+="<input name=\"PrizeImg8\" class=\"input_text prizetype1\" type=\"hidden\" /><div class=\"onepic prizetype1\" style=\"display: inline-block;\"></div>";
            html8+="<span class=\"tips prizetype1\">建议尺寸：120×120</span>";
            html8+="</div></td></tr>";
            html8+="";
            html8+="";
            html8+="";
            html8+="";
            html8+="";

            $('tr.img8').last().after(html8);
            //initjggimg();
            initonepic();
        })<%=(rptPrize8.Items.Count==0)?".click();":""%>

        function Change8(obj){
            var index = $(obj).val();
            $(obj).parents('tr').find('.prizetype1, .prizetype2, .prizetype3,.prizetype4').hide();
            $(obj).parents('tr').find('.prizetype' + index).show().css('display', 'inline-block');
        }
        function Point8(){
            if($('#point8').attr('checked')=='checked')
            {
                $('.prom88').show();
            }else{
                $('.prom88').hide();
            }
        }
        //初始化
        $('.datetime').focus(function () {            
            WdatePicker({ startDate: '%y-%M-%d', minDate: '%y-%M-%d', dateFmt: 'yyyy-MM-dd HH:mm:ss', alwaysUseStartDate: true });
        });
        //设定显示类型
        $('#proType' + $('#proType').val() + ',#protype2' + $('#proType').val()).attr('checked', 'checked');
        $('.proms, .tab1, .tab2').hide();
        if ($('#proType').val() == '2') {
            if($('#proParticipation').val()=="2"){
                $('.Participation').show();
            }
        }
        if ($('#proType').val() == '3') {
            $('#proGoods').parents('tr').hide();
           if( $('#proParticipation').val()=="2"){
                $('.Participation').show();
            }
        }
        if ($('#proType').val() == '4') {
            $('.hdtit_rplist :checkbox').removeAttr('checked');
            $('#selall').attr('disabled', true);
            $('.hdtit_rptit font').html('(0)');
            $('.tab0').hide();
            $('.tab1').show();
        } else if ($('#proType').val() == '6') {
            $('.prom' + ($('#proType').val() != '' ? $('#proType').val() : '1')).show();
            $('#proParticipation,#proGoods').parents('tr').hide();
            $('.hdtit_rplist :checkbox').removeAttr('checked');
            $('#selall').attr('disabled', true);
            $('.Participation').show();
            $('#proNumber').change(function () {
                if ($(this).val() > 0) {
                    $('#proParticipation').val(2);
                } else if ($(this).val() == 0) {
                    $('#proParticipation').val(4);
                }
            })

        }
        else {
            $('.prom' + ($('#proType').val() != '' ? $('#proType').val() : '1')).show();
            if ($('#proType').val() == '5' || $('#proType').val() == '6' || $('#proType').val() == '8') {
                $('#proParticipation,#proGoods').parents('tr').hide();
                $('.hdtit_rplist :checkbox').removeAttr('checked');
                $('#selall').attr('disabled', true);
                $('.hdtit_rptit font').html('(0)');
                if($('#proType').val() == '8'){
                    Point8();
                }
            }

        }
                
        var msgarr = ['打折活动针对商家指定商品进行打折。', '设置优惠券。', '免费赠送。', '秒杀活动设置', '砸金蛋设置', '在手机网站、电脑网站上推广，增加微信粉丝。','', '九宫格设置。'];
        $('[name=proType1],[name=protype2]').click(function () {
            var index = $(this).val();
            $('#proType').val(index);
            $('[name=proType1],[name=protype2]').removeAttr('checked');
            $('#proType' + index + ',#protype2' + index).attr('checked', 'checked');

            if (index < 4) {
                $('.proms, .tab1, .tab2').hide();
                $('.tab0').show();
                $('.prom' + $(this).val()).show();
                $('.hdtit_rplist :checkbox').removeAttr('checked');              
                $('#selall').removeAttr('disabled');
                $('.hdtit_rptit font').html('(0)');
                $('#proParticipation,#proGoods').parents('tr').show();
                if (index == 3) {
                    $('#proGoods').parents('tr').hide();
                }
            } else if (index == 4) {
                //切换到秒杀
                $('.hdtit_rplist :checkbox').removeAttr('checked');
                $('#selall').attr('disabled', true);
                $('.hdtit_rptit font').html('(0)');
                $('.tab0').hide();
                $('.tab1').show();
            } else if (index == 5) {
                //切换到砸金蛋
                $('.proms, .tab1, .tab2').hide();
                $('.tab0').show();
                $('.prom' + $(this).val()).show();
                $('#proParticipation,#proGoods').parents('tr').hide();
                $('.hdtit_rplist :checkbox').removeAttr('checked');
                $('#selall').attr('disabled', true);
                $('.hdtit_rptit font').html('(0)');

            }else if (index == 8) {
                $('.proms, .tab1, .tab2').hide();
                $('.tab0').show();
                $('.prom' + $(this).val()).show();
                $('#proParticipation,#proGoods').parents('tr').hide();
                $('.hdtit_rplist :checkbox').removeAttr('checked');
                $('#selall').attr('disabled', true);
                $('.hdtit_rptit font').html('(0)');
                Point8();
            }
            else if (index == 6) {
                //切换到加粉
                $('.proms, .tab1, .tab2').hide();
                $('.tab0').show();
                $('.prom' + $(this).val()).show();
                $('#proParticipation,#proGoods').parents('tr').hide();
                $('.hdtit_rplist :checkbox').removeAttr('checked');
                $('#selall').attr('disabled', true);
                $('.hdtit_rptit font').html('(0)');
                $('.Participation').show();
            }
            $('#lbMsg').html(msgarr[index - 1]);
            $('.lmlx_ts').show();
        });

        //$('[name=protype2]').change(function () {
        //    var index = $(this).val();
        //    $('#proType').val(index);
        //    $('[name=proType1]').removeAttr('checked');
        //    $('#proType' + index).attr('checked', 'checked');
        //    if (index < 4) {
        //       $('.proms, .tab1, .tab2').hide();       
        //        $('.tab0').show();
        //        $('.prom' + $(this).val()).show();
        //    } else if (index == 4) {
        //        $('.tab0').hide();
        //        $('.tab1').show();
        //    }
        //});

        //关闭类型提示条
        $('.lmx_but').click(function () {
            $('.lmlx_ts').hide();
        })

        //proDiscountType折扣提示        
        $('#proDiscountType').change(function () {
            $('.proDiscountType1,.proDiscountType2').hide();
            $('.proDiscountType' + $(this).val()).show();
        }).change();
        //切换秒杀步骤
        $('.hd_mslc li').attr('style', 'cursor:pointer').click(function () {
            var index = $(this).index() + 1;
            $('.tab1, .tab2').hide();
            $('.tab' + index).show();

        });

        $('.btnseckill1').click(function () {
            $('.tab1').hide();
            $('.tab2').show();
        });
        $('.btnseckill2').click(function () {
            $('#save').click();
        })

        //预览模版
        $(function () {
            //data-url
            $(".msxyl").click(function () {
                makeHuixianceng();
                var proid = getName('id');
                if (proid != "") {
                    var url = '/PlugIn/Promotion/Seckill/Index.Aspx?GetStatus=yulan&PromotionId=' + proid;
                    $('.tem_ifm').attr('src', url);
                }
                $(".tem_mdiv").center().show();
            });

            $(".tem_mdiv_tit span").click(function () {
                makeHuixianceng();
                $(".tem_mdiv").center().hide();
            });
        });

        //输入检测    
        $(':text').focus(function () {
            $(this).next('.tips, .tips5').show();
        }).blur(function () {
            if ($.trim($(this).val()) == "" || ($(this).attr('data-type') == 'int' && isNaN(parseInt($(this).val()))) || ($(this).attr('data-type') == 'float' && isNaN(parseFloat($(this).val()))) || ($(this).attr('max') != "" && parseFloat($(this).attr('max')) < parseFloat($(this).val())) || ($(this).attr('min') != "" && parseFloat($(this).attr('min')) > parseFloat($(this).val())) ) {
                $(this).next('.tips, .tips5').addClass('tip_er').removeClass('tip_ok');
            } else {
                $(this).next('.tips, .tips5').removeClass('tip_er').addClass('tip_ok');
            }
            
        });
        
        $('select').blur(function () {
            //打折
            if ($('#proType').val() == 1) {
                if ($('#proDiscountType, #proParticipation').val() == "") {
                    $('#proDiscountType, #proParticipation').next('.tips, .tips5').addClass('tip_er').removeClass('tip_ok');
                } else {
                    $('#proDiscountType, #proParticipation').next('.tips, .tips5').addClass('tip_ok').removeClass('tip_er');
                }
            } else if ($('#proType').val() == 2) {
                if ($('#proParticipation').val() == "") {
                    $('#proParticipation').next('.tips, .tips5').addClass('tip_er').removeClass('tip_ok');
                } else {
                    $('#proParticipation').next('.tips, .tips5').addClass('tip_ok').removeClass('tip_er');
                }
            } else if ($('#proType').val() == 3) {
                if ($('#proParticipation').val() == "") {
                    $('#proParticipation').next('.tips, .tips5').addClass('tip_er').removeClass('tip_ok');
                } else {
                    $('#proParticipation').next('.tips, .tips5').addClass('tip_ok').removeClass('tip_er');
                }
            }
        });
        //$(function () {
        //    $('form').submit(function () {
        //        var err = 0
        //        $(':text').each(function () {
        //            if ($.trim($(this).val()) == "" || ($(this).attr('data-type') == 'int' && isNaN(parseInt($(this).val()))) || ($(this).attr('data-type') == 'float' && isNaN(parseFloat($(this).val())))) {
        //                $(this).focus().next('.tips').addClass('tip_er').removeClass('tip_ok');
        //                err++;
        //                return false;
        //            }
        //        })
        //        if (err > 0) return false;
        //    });
        //});
        var lfunid = 0;
        var lcateid = 0;
        var xzcheck = '';
        var goodsnames = $('#GoodsName').val();
        var goodsprices = $('#GoodsPrice').val();
        var goodsids = $('#GoodsId').val();
        var goodsfunids = $('#FunctionId').val();
        var goodscateids = $('#GoodsCateId').val();
        $('.addhdsp').next('.tips').html('已指定' + (goodsids == '' ? '0' : goodsids.split(',').length) + '件商品').attr('title', '已指定：' + goodsnames);
        $('.Participation').hide();
        //显示选择商品
        $(".addhdsp").click(function () {
            if ($(this).hasClass('prizetype2')) {
                $('body').data('prize', $('button.addhdsp.prizetype2').index($(this)));               
            }             
            makeHuixianceng();
            $(".zdsphd_mdiv").show().center();
        });

        //关闭对话框
        $(".zdsphd_tit span, .xzcancel").click(function () {
            makeHuixianceng();
            $(".zdsphd_mdiv").hide();
            $("#back").remove();
        });
        $(window).scroll(function () {
            $(".zdsphd_mdiv").center();
        });

        //左侧折叠
        $('.goodscate').click(function () {
            $('.goodscate a').removeClass('zdhd_dth');
            $(this).find('a').addClass('zdhd_dth');
            $('.hd_ldlist').hide();
            $(this).next('.hd_ldlist').show();
            lfunid = $('.goodscate a').attr('funid');
            lcateid = 0;
        });
        $('.goodscate:first').click();


        //全选
        $('#selall').click(function () {
                      
            $('.hdtit_rplist  :checkbox[funid=' + lfunid + '][cateid=' + lcateid + ']:enabled').attr('checked', $(this).attr('checked') == 'checked');
            $('.hdtit_rptit font').html('(' + $('.hdtit_rplist :checked').length + ')');
            if ($(this).attr('checked') == 'checked') {
                //$('.hd_ldlist li[funid][cateid]').each(function () {                
                //    $(this).find('.lbxz').html($(this).find('.lball').html());                
                //})
                $('.hd_ldlist li[funid=' + lfunid + '][cateid=' + lcateid + '] span.lbxz').html($('.hd_ldlist li[funid=' + lfunid + '][cateid=' + lcateid + '] span.lball').html());

            } else {
                //$('.hd_ldlist li[funid][cateid] span.lbxz').html('0');
                $('.hd_ldlist li[funid=' + lfunid + '][cateid=' + lcateid + '] span.lbxz').html('0');
            }

            $('.hdtit_ldiv .mem_zdhd' + lfunid + ' .lbxz').html($('.hdtit_rplist :checked[funid=' + lfunid + ']').length);
        });
        //选中商品
        $('.hdtit_rplist :checkbox').live('click', function () {
            if (($('#proType').val() == '4' || $('#proType').val() == '5' || $('#proType').val() == '8') && $('.hdtit_rplist :checked').length > 1) {
                event.srcElement.checked = false; //取消选中
            }
            $('.hdtit_rptit font').html('(' + $('.hdtit_rplist :checked').length + ')');
            var funid = $(this).attr('funid');
            var cateid = $(this).attr('cateid');
            $('.hd_ldlist li[funid=' + funid + '][cateid=' + cateid + '] span.lbxz').html($('.hdtit_rplist :checked[funid=' + funid + '][cateid=' + cateid + ']').length);
            $('.hdtit_ldiv .mem_zdhd' + funid + ' .lbxz').html($('.hdtit_rplist :checked[funid=' + funid + ']').length);

        });
        //提交选中商品到隐藏域
        $('.xzok').click(function () {
            goodsids = $('.hdtit_rplist :checked').map(function () { return $(this).attr('goodsid') }).get().join(',');
            goodsnames = $('.hdtit_rplist :checked').map(function () { return $(this).attr('goodsname') }).get().join(',');
            goodsprices = $('.hdtit_rplist :checked').map(function () { return $(this).attr('price') }).get().join(',');
            goodsfunids = $('.hdtit_rplist :checked').map(function () { return $(this).attr('funid') }).get().join(',');
            goodscateids = $('.hdtit_rplist :checked').map(function () { return $(this).attr('cateid') }).get().join(',');
            if ($('#proType').val() < '5') {

                $('#GoodsId').val(goodsids);
                $('#GoodsName').val(goodsnames);
                $('#GoodsPrice').val(goodsprices);
                $('#FunctionId').val(goodsfunids);
                $('#GoodsCateId').val(goodscateids);
                $('.addhdsp').next('.tips').html('已指定' + goodsids.split(',').length + '件商品').attr('title', '已指定：' + goodsnames);
            } else if ($('#proType').val() == '5') {
                //砸金蛋每个奖项选择一个商品
                var index = $('body').data('prize');
                $('[name=PrizeGoodsFunId]').eq(index).val(goodsfunids);
                $('[name=PrizeGoodsCateId]').eq(index).val(goodscateids);
                $('[name=PrizeGoodsId]').eq(index).val(goodsids);
                $('[name=PrizeGoodsName]').eq(index).val(goodsnames);
                $('button.addhdsp.prizetype2').eq(index).html(goodsnames);
            }else if ($('#proType').val() == '8') {
                //九宫格每个奖项选择一个商品
                var index = $('body').data('prize');
                $('[name=PrizeGoodsFunId]').eq(index).val(goodsfunids);
                $('[name=PrizeGoodsCateId]').eq(index).val(goodscateids);
                $('[name=PrizeGoodsId]').eq(index).val(goodsids);
                $('[name=PrizeGoodsName]').eq(index).val(goodsnames);
                $('button.addhdsp.prizetype2').eq(index).html(goodsnames);
            } else if ($('#proType').val() == '6') {
                //砸金蛋每个奖项选择一个商品
                var index = $('body').data('prize');
                $('[name=PrizeGoodsFunId6]').val(goodsfunids);
                $('[name=PrizeGoodsCateId6]').val(goodscateids);
                $('[name=PrizeGoodsId6]').val(goodsids);
                $('[name=PrizeGoodsName6]').val(goodsnames);
                $('button.addhdsp.prizetype2').eq(index).html(goodsnames);
            }

            $('.xzcancel').click();
        });

        //显示选中类别商品
        var additem = 0;
        var checkone = true;
        $('.hd_ldlist li').click(function () {
            var funid = $(this).attr('funid');
            var cateid = $(this).attr('cateid');
            var num = $(this).find('.lbxz').html();             
             checkone = true;
            $('.hd_ldlist li').find('.lbxz').each(function(){
                if($(this).html()!='0' && $(this).html() !=num && $(this).closest('li').attr('funid') !='20'){
                    alert('只能选择一个分店的商品，取消后再选择其他分店');
                    checkone =false;
                }
            });
            if (additem != 0 || checkone==false) return false;
            $('.hd_ldlist li a').removeClass('zdhd_dth');
            $(this).find('a').addClass('zdhd_dth');
          

            lfunid = funid;
            lcateid = cateid;
            var total = 0;
            var viewcount = 0;
            var page = parseInt(getName('page')) > 1 ? parseInt(getName('page')) : 1;
            var size = parseInt(getName('size')) > 1 ? parseInt(getName('size')) : 1200;
            var content = '';
            // $('.hdtit_rptit font').attr('checked');
            $('#selall').removeAttr('checked');
            $('.hdtit_rpage').attr('funid', funid)
                             .attr('cateid', cateid)
                             .attr('page', page + 1)
                             .attr('size', size);
            $('.hdtit_rplist ul li').hide();
            total = $(this).find('.lball').html();
            $('.goodscount').html(total);
            $('.goodsviewcount').html(0);
            if ($('.hdtit_rplist ul li.f' + funid + 'c' + cateid).length > 0) {
                $('.hdtit_rplist ul li.f' + funid + 'c' + cateid + ', .hdtit_rplist ul li.f' + funid + 'c' + cateid + ' li').show();
                viewcount = $('.hdtit_rplist ul li.f' + funid + 'c' + cateid).length;
                $('.goodsviewcount').html(viewcount);
                if (total > viewcount) {
                    $('.hdtit_rpage').attr('next', '1');
                } else {
                    $('.hdtit_rpage').removeAttr('next');
                }
            } else {
                additem = 1;
                $.get('?getgoodslist=1&MicroId=' + getName('MicroId') + '&funid=' + funid + '&cateid=' + cateid + '&page=' + page + '&size=' + size + '&protype=' + $('#proType').val() + "&id=" + getName('id'), function (data) {
                    var d = eval(data);
                    d = d[0];
                    total = d.total;
                    additem = 0;
                    if (total > 0) {
                        viewcount = (parseInt(d.page) - 1) * size + parseInt(d.size);
                        content = unescape(d.content);
                        $('.hdtit_rplist ul').html($('.hdtit_rplist ul').html() + content);
                        $('.goodsviewcount').html(viewcount);
                        $('.goodscount').html(total);
                        if (total > viewcount) {
                            $('.hdtit_rpage').attr('next', '1');

                        } else {
                            $('.hdtit_rpage').removeAttr('next');
                        }

                    }
                });

            }
        });

        //加载下一页
        $('.hdtit_rpage').click(function () {
            if ($(this).attr('next') != '1') return false;
            var funid = $(this).attr('funid');
            var cateid = $(this).attr('cateid');
            var total = 0;
            var viewcount = 0;
            var page = parseInt($(this).attr('page')) > 1 ? parseInt($(this).attr('page')) : 1;
            var size = parseInt($(this).attr('size')) > 1 ? parseInt($(this).attr('size')) : 12;
            var content = '';
            $.get('?getgoodslist=1&MicroId=' + getName('MicroId') + '&funid=' + funid + '&cateid=' + cateid + '&page=' + page + '&size=' + size, function (data) {
                var d = eval(data);
                d = d[0];
                total = d.total;
                if (total > 0) {
                    viewcount = (parseInt(d.page) - 1) * size + parseInt(d.size);
                    content = unescape(d.content);
                    $('.hdtit_rplist ul').html($('.hdtit_rplist ul').html() + content);
                    $('.goodsviewcount').html(viewcount);
                    $('.goodscount').html(total);
                    if (total > viewcount) {
                        $('.hdtit_rpage').attr('next', '1')
                            .attr('funid', funid)
                            .attr('cateid', cateid)
                            .attr('page', page + 1)
                            .attr('size', size);
                    } else {
                        $('.hdtit_rpage').removeAttr('next');
                    }

                }
            })
        });

        $('#search').click(function () {
            if ($.trim($('#keyword').val()) != "") {
                var total = 0;
                var viewcount = 0;
                var page = parseInt(getName('page')) > 1 ? parseInt(getName('page')) : 1;
                var size = 50;
                var content = '';

                funid = lfunid;
                cateid = lcateid;
                if (funid == "") {
                    alert('请先选择左边列表');
                    return false;
                }

                $('.hdtit_rpage').attr('funid', funid)
                                 .attr('cateid', cateid)
                                 .attr('page', page + 1)
                                 .attr('size', size);
                $('.hdtit_rplist ul li').hide();
                $('.goodscount').html(0);
                $('.goodsviewcount').html(0);
                $.get('?getgoodslist=1&MicroId=' + getName('MicroId') + '&funid=' + funid + '&cateid=' + cateid + '&page=' + page + '&size=' + size + '&word=' + $('#keyword').val(), function (data) {
                    var d = eval(data);
                    d = d[0];
                    total = d.total;
                    if (total > 0) {
                        viewcount = parseInt(d.size);
                        content = unescape(d.content);
                        $('.hdtit_rplist ul').html(content);
                        $('.goodsviewcount').html(viewcount);
                        $('.goodscount').html(total);

                    }
                });

            }

        });

        //领取方式值1,3,5时，发放数量变更成0，不限
        $('#proParticipation').change(function () {
            if ($(this).val() == '1' || $(this).val() == '3' || $(this).val() == '5') {
                $('.Participation').hide();
                $('#proNumber').val('0');

            } else {
                $('.Participation').show();
            }
        })

        //砸金蛋
        //奖品奖项切换
        $('.PrizeType').change(function () {
            var index = $(this).val();
            $(this).parents('tr').find('.prizetype1, .prizetype2, .prizetype3,.prizetype4').hide();
            $(this).parents('tr').find('.prizetype' + index).show().css('display', 'inline-block');
        })
        //初始化奖项
        $('.PrizeType').each(function () {
            $(this).change();
        })
        //  每天抽奖次数不能大于抽奖次数
        $('#proEggDayNumber').blur(function () {
            var n = $(this).val();
            if (n > parseInt($('#proEggMaxNumber').val()) && parseInt($('#proEggMaxNumber').val())>0) {
                $(this).focus();
                $(this).next('.tips, .tips5').removeClass('tip_ok').addClass('tip_er');
            } else {
                $(this).next('.tips, .tips5').removeClass('tip_er').addClass('tip_ok');
            }
        })

        //优惠券 减额要小于订单金额
        $('#proCouponValue').blur(function () {
            var val = parseFloat($(this).val());
            if (val > parseFloat($('#proCouponOrderMoney').val())) {         
                $(this).focus();
                $(this).next('.tips, .tips5').removeClass('tip_ok').addClass('tip_er');
            } else {
                $(this).next('.tips, .tips5').removeClass('tip_er').addClass('tip_ok');
            }
        })

        //根据功能管理里选中的活动功能来显示功能列表
        $(':radio[value=4],:radio[value=5],:radio[value=6],:radio[value=8]').attr('disabled','disabled');
        <%
        string str = String.Join(",", PromotionFunctions);
        if (str.IndexOf("秒杀") > -1)
        { 
        %>
        $(':radio[value=4]').removeAttr('disabled');
        <%
        }
        if (str.IndexOf("砸金蛋") > -1)
        { 
        %>
        $(':radio[value=5]').removeAttr('disabled');
        <%
        }
        if (str.IndexOf("九宫格") > -1)
        { 
        %>
        $(':radio[value=8]').removeAttr('disabled');
        <%
        }
        if (str.IndexOf("加粉") > -1)
        { 
        %>
        $(':radio[value=6]').removeAttr('disabled');
        <%
        }
        %>

        $('#proSeckillNumber').blur(function () {
            if (('#proType').val() == '4' && $(this).val() < 1) {
                $(this).next('.tips, .tips5').addClass('tip_er').removeClass('tip_ok');
            } else if (('#proType').val() == '4' && $(this).val() > 0) {
                $(this).next('.tips, .tips5').removeClass('tip_er').addClass('tip_ok');
            }
            
        })
        
        $('form').submit(function () {
            if ($('#proType').val() == '4' && $('#proSeckillNumber').val() < 1) {                
                return false;
            } else if ($('#proType').val() == '4' && $('#GoodsId').val() == "") {
                alert('请选择秒杀商品');
                return false;
            }

        })
    </script>
</body>
</html>
